<div class="view-handle-main">
    <div class="view-search">
        <div class="search-shop">
            <i class="fa fa-home"></i>
            <shop-picker shop="shop"></shop-picker>
        </div>
        <div class="search-date">
            <i class="fa fa-calendar search-date-i"></i>
            <datetimepicker class="search-date-start"
                                    min-view="3"
                                    start-view="3"
                                    format="yyyy-mm"
                                    end-date="_today"
                                    today-btn="true"
                                    ng-model="date"></datetimepicker>
        </div>
    </div>
    
    <div class="view-handle">
        <div class="view-header-item no-widen" ng-click="refresh()" title="查询">
            <i class="fa fa-search"></i>
        </div>
        <div class="view-header-item color-open" ng-click="salesman.add_new_header_show()" title="添加">
            <i class="fa fa-plus"></i> 添加分组
        </div>
        <div class="view-header-item color-submit no-widen" ng-click="salesman.synchronization()" title="同步">
            <i class="fa fa-refresh"></i>
        </div>
        <!--         <div class="view-header-item color-close above-cover no-widen" ng-click='salesman_revise_cover = !salesman_revise_cover' title="关闭" ng-show='salesman_revise_cover'>
            <i class="fa fa-close"></i>
        </div>
        <div class="view-header-item color-check above-cover no-widen" ng-click='salesman_revise_submit()' title="提交" ng-show='salesman_revise_cover'>
            <i class="fa fa-save" ng-show="salesman_revise_cover"></i>
        </div> -->
    </div>

</div>



        <!-- 查询 搜索 -->
        


        <!--修改 分组 -->
<!--         <div class="view-header-item color-close above-cover no-widen" ng-click='salesman_revise_cover = !salesman_revise_cover' title="关闭" ng-show='salesman_revise_cover'>
            <i class="fa fa-close"></i>
        </div>
        <div class="view-header-item color-check above-cover no-widen" ng-click='salesman_revise_submit()' title="提交" ng-show='salesman_revise_cover'>
            <i class="fa fa-save" ng-show="salesman_revise_cover"></i>
        </div> -->

<div class="view-content reception-content view-middle">
    <div class="new-content clearfix help-doc" ng-show="toggle_help" >
        <h3>销售人员分组</h3>
        <p>销售人员必须在录入销量前分配好分组，分组数据只保留一个月，从下月1号0点开始，需要重新分组。</p>
        <p>分组前先同步本门店销售人员</p>
        <p>点击放大镜查询门店销售</p>
        <p>在点击菜单栏加号创建分组</p>
        <p>在 未分配的销售人员 一列中选中需要添加的销售，点击右侧 加号 进行添加</p>
    </div>
    <div class="view-left">
        <div class="view-left-search">
            <input type="text" placeholder='Search' ng-model="shop_user_shop_filter">
            <i class="fa fa-search"></i>
        </div>
        <div class="view-left-block">
            <div class="view-left-item" style="height:auto;" ng-show="new_header.toggle">
                <li>
                    <i class="fa fa-user"></i>
                </li>
                <li class="view-left-item-user" style="width:5em;">
                    <input type="text" style="padding:0;width:95%;" ng-model="salesman.new_header.name">
                </li>

                <li class="view-left-item-user" style="width:5em;">
                    <select ng-model="salesman.new_header.type" style="padding:0;width:95%;">
                        <option>普通</option>
                        <option>大客户</option>
                    </select>
                </li>

                <li style="line-height:1.8;">
                    <input type="button" value="添加"
                                         class="btn btn-success"
                                         ng-click="salesman.add_new_header()">
                </li>
                <li class="view-left-item-del">
                    <i class="fa fa-trash" ng-click="delete();$event.stopPropagation()"></i>
                </li>
                
                
            </div>
            <div ng-repeat="header in salesman.headers"
                     class ="view-left-item {{salesman.header === header ? 'marked' : '' }}"
                     ng-click="salesman.header=header;salesman.getSalesmenByHeader(header);">
                <li>
                    <i class="fa fa-user"></i>
                </li>
                <li class="view-left-item-user">
                    {{header.name}}
                </li>
                <li class="view-left-item-user">
                    {{header.type}}
                </li>
                <li class="view-left-item-del">
                    <i class="fa fa-trash" ng-click="salesman.remove_group(header.id);$event.stopPropagation()"></i>
                </li>
                <li class="view-left-item-del">
                    <i class="fa fa-edit" ng-click="salesman_revise_open(header);$event.stopPropagation()"></i>
                </li>
            </div>
        </div>
    </div>



    <div class="privilege-right achievements-right" style="width: 60%;">
        <div class="privilege-right-content achievements-right-content">
            <div class="view-left-search privilege-und-bg">
                <input type="text" placeholder='未分配的销售人员' ng-model="shop_user_now_filter">
            </div>
            <div class="privilege-right-block">
                <div class="privilege-right-item" 
                ng-repeat="list in salesman.salesmenWithoutHeader" 
                ng-click="salesman.addHeader(list)" >
                    <li class="privilege-right-name">{{list.name}}</li>
                    <li class="privilege-right-plus">
                        <i class="fa fa-plus"></i>
                    </li>
                </div>
            </div>
        </div>
        <div class="privilege-right-content achievements-right-content">
            <div class="view-left-search privilege-und-bg ach-pla-color">
                <input type="text" placeholder='{{salesman.header.name ? (salesman.header.name + "组") : "请选择分组"}}' ng-model="shop_user_user_filter">
            </div>
            <div class="privilege-right-block">
                <div class="privilege-right-item" 
                ng-repeat="list in salesman.salesmenByHeader" 
                ng-click="salesman.removeSalesman(list)">
                    <li class="privilege-right-name">{{list.name}}</li>
                    <li class="privilege-right-plus">
                        <i class="fa fa-minus"></i>
                    </li>
                </div>
            </div>
        </div>

    </div>

</div>

<!-- 分组修改 -->
<div class="data-overlay" ng-show='salesman_revise_cover'>
    <div class="overlay-container">
        <div class="overlay-header">分组修改</div>
        <div ng-form name="salesman_revise_form" novalidate="novalidate">
            <div class="overlay-content">
                <div class="overlay-column overlay-column-3">
                    <div class="overlay-item">
                        <span class="overlay-name">分组名</span>
                        <input type="text" ng-model="salesman_revise.name">
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">组类别</span>
                        <select ng-model="salesman_revise.type" style="padding:0;">
                            <option>DCC</option>
                            <option>展厅</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>